import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
import Layout from '../views/Home.vue'

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    redirect: '/welcome'
  },
  {
    path: '/',
    component: Layout,
    children: [
      { path: '/welcome', component: import('@/views/Welcome.vue') },
      { path: '/users', component: () => import('@/views/User/List.vue') }
      // { path: "/roles", component: Role },
      // { path: "/rights", component: Rights },
      // { path: "/categories", component: Categories },
      // { path: "/params", component: Params },
      // { path: "/goods", component: Goods },
      // { path: "/addgood", component: AddGood },
      // { path: "/editgood/:id", component: EditGood, name: "editGood" },
      // { path: "/orders", component: Orders },
      // { path: "/reports", component: Reports },
    ]
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/Login.vue')
  }
]

const router = createRouter({
  history: createWebHashHistory(), // 路由模式
  routes // 路由规则
})

router.beforeEach((to, from) => {})

router.afterEach(() => {})

export default router
